package com.bw.jetpacktest.databinding;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bw.jetpacktest.R;

public class DataBindingActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_databinding);
        findViewById(R.id.basic_btn).setOnClickListener(this);
        findViewById(R.id.once_btn).setOnClickListener(this);
        findViewById(R.id.double_btn).setOnClickListener(this);
        findViewById(R.id.click_btn).setOnClickListener(this);
        findViewById(R.id.list_btn).setOnClickListener(this);
        findViewById(R.id.frg_btn).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        switch (id){
            case R.id.basic_btn:
                startActivity(new Intent(this,BasicActivity.class));
                break;
            case R.id.once_btn:
                startActivity(new Intent(this,OnceActivity.class));
                break;
            case R.id.double_btn:
                startActivity(new Intent(this,DoubleActivity.class));
                break;
            case R.id.click_btn:
                startActivity(new Intent(this,ClickActivity.class));
                break;
            case R.id.list_btn:
                startActivity(new Intent(this,RecyclerViewActivity.class));
                break;
            case R.id.frg_btn:
                startActivity(new Intent(this,BindFragmentActivity.class));
                break;
        }
    }
}
